#author: 金荣财
#dest: 九九乘法表


#正排
for x in range(1, 10):
    for y in range(1, x+1):
        print(str(y) + '*' + str(x) + "=" + str(x*y), end=" ")
    print("\n")

#倒排
for x in range(9, 0, -1):
    for y in range(1, x+1):
        print(str(y) + '*' + str(x) + "=" + str(x*y), end=" ")
    print("\n")